﻿using System;
using System.Data.SqlClient;
using MySql.Data.MySqlClient;
using OutDbContext;
using User.Api.BizExtensions;
using System.Configuration;
using System.Globalization;

namespace User.Api.Helpers
{
    public class DataBaseCommandFactory
    {
        private static  IDbDatabaseCommand _idbDatabaseCommand = null;


        public static IDbDatabaseCommand CreateDatbaseCommand()
        {
            if (_idbDatabaseCommand == null)
            {
                string dbType = ConfigurationManager.AppSettings["DatabaseType"];
                if (dbType == "MySql")
                {
                    _idbDatabaseCommand = new MySqlDatbaseCommand();
                }
                else
                {
                    _idbDatabaseCommand = new SqlServerDatbaseCommand();
                }
            }
            return _idbDatabaseCommand;
        }
    }

    public interface IDbDatabaseCommand
    {
        void UpdateOrderStatus(int orderId, int orderStatus);
        void PickupSuccess(int orderId, string regNo, string beginTime, string endTime, string address, string visitNo);
        void Refunding(int orderId);
        void RefundSuccess(int orderId, string refundId);
        void RefundError(int orderId);
        void WeixinRefunding(int orderId);
        void WeixinRefundSuccess(int orderId, string refundId);
        void WeixinRefundError(int orderId);
        void CancelByUser(int orderId);
        void CancelBySys(int orderId);
        void CancelByHosp(int orderId);
        void LockSuccessAndAppt(int orderId, string infoSeq);
        void ApptSuccess(int orderId,string address,string bookingNo,string vistiNo,string regNo);
        void PaySuccess(int orderId, string wxTranscationId);
        void WeixinPaySuccess(int orderId, string transactionId, string timeEnd);
    }

    public class MySqlDatbaseCommand : IDbDatabaseCommand
    {
        public void UpdateOrderStatus(int orderId,int orderStatus)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                //ctx.UpdateApptOrder(orderId, ApptOrderExtensions.OrderStatus.取号中.ToInt32());
                MySqlParameter[] para =
                {
                            new MySqlParameter("@OrderStatus", orderStatus),
                            new MySqlParameter("@OrderId", orderId),
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus where Id=@OrderId", para);
            }
        }

        public void PickupSuccess(int orderId,string regNo,string beginTime,string endTime,string address,string visitNo)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                                new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.取号成功.ToInt32()),
                                new MySqlParameter("@RegNo", regNo),
                                new MySqlParameter("@SuggestBeginTime", beginTime),
                                new MySqlParameter("@SuggestEndTime", endTime),
                                new MySqlParameter("@Location", address),
                                new MySqlParameter("@VisitNo", visitNo),
                                new MySqlParameter("@FetchTime", DateTime.Now),
                                new MySqlParameter("@OrderId",orderId)
                };
                ctx.Database.ExecuteSqlCommand("Update ApptOrder set OrderStatus= @OrderStatus," +
                                               "RegNo = @RegNo,SuggestBeginTime=@SuggestBeginTime," +
                                               "SuggestEndTime=@SuggestEndTime,Location=@Location,VisitNo=@VisitNo," +
                                               "FetchTime=@FetchTime where Id=@OrderId", para);
            }
        }

        public void Refunding(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para =
                {
                    new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.退款中.ToInt32()),
                    new MySqlParameter("@PayState", ApptOrderExtensions.PayState.退款中.ToInt32().ToString()),
                    new MySqlParameter("@RefundReason", "取号失败而退款"),
                    new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason where Id=@OrderId",
                    para);
            }
        }

        public void RefundSuccess(int orderId,string refundId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para = {
                        new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.退款成功.ToInt32()),
                        new MySqlParameter("@PayState", ApptOrderExtensions.PayState.已退款.ToInt32().ToString()),
                        new MySqlParameter("@RefundReason", "取号失败而退款"),
                        new MySqlParameter("@RefundTime", DateTime.Now),
                        new MySqlParameter("@WxRefundId", refundId),
                        new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason, " +
                    "RefundTime = @RefundTime,WxRefundId = @WxRefundId where Id=@OrderId", para);
            }
        }

        public void RefundError(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para = {
                        new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.退款失败.ToInt32()),
                        new MySqlParameter("@PayState", ApptOrderExtensions.PayState.退款失败.ToInt32().ToString()),
                        new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState where Id=@OrderId",
                    para);

            }
        }

        public void WeixinRefunding(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para =
                {
                    new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.微信退号退款中.ToInt32()),
                    new MySqlParameter("@PayState", ApptOrderExtensions.PayState.退款中.ToInt32().ToString()),
                    new MySqlParameter("@RefundReason", "因退号而退款"),
                    new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason where Id=@OrderId",
                    para);
            }
        }

        public void WeixinRefundSuccess(int orderId,string refundId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para = {
                        new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.微信退号退款成功.ToInt32()),
                        new MySqlParameter("@PayState", ApptOrderExtensions.PayState.已退款.ToInt32().ToString()),
                        new MySqlParameter("@RefundReason", "因退号而退款"),
                        new MySqlParameter("@RefundTime", DateTime.Now),
                        new MySqlParameter("@WxRefundId", refundId),
                        new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason, " +
                    "RefundTime = @RefundTime,WxRefundId = @WxRefundId where Id=@OrderId", para);
            }
        }

        public void WeixinRefundError(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para = {
                        new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.微信退号退款失败.ToInt32()),
                        new MySqlParameter("@PayState", ApptOrderExtensions.PayState.退款失败.ToInt32().ToString()),
                        new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState where Id=@OrderId",
                    para);

            }
        }

        public void CancelByUser(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                            new MySqlParameter("@CancelByUserTime", DateTime.Now),
                            new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set CancelByUserTime= @CancelByUserTime where Id=@OrderId", para);
            }
        }
        public void CancelBySys(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                            new MySqlParameter("@CancelBySysTime", DateTime.Now),
                            new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set CancelBySysTime= @CancelBySysTime where Id=@OrderId", para);
            }
        }

        public void CancelByHosp(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                            new MySqlParameter("@CancelByHospTime", DateTime.Now),
                            new MySqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set CancelByHospTime= @CancelByHospTime where Id=@OrderId", para);
            }
        }

        public void LockSuccessAndAppt(int orderId,string infoSeq)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para =
                {
                    new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.锁号成功.ToInt32()),
                    new MySqlParameter("@LockTime", DateTime.Now),
                    new MySqlParameter("@OrderId", orderId),
                    new MySqlParameter("@InfoSeq",infoSeq)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,LockTime = @LockTime,InfoSeq=@InfoSeq where Id=@OrderId", para);


                MySqlParameter[] para1 =
                {
                    new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.预约中.ToInt32()),
                    new MySqlParameter("@OrderId", orderId),
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus where Id=@OrderId", para1);
            }

        }

        public void ApptSuccess(int orderId,string address, string bookingNo, string vistiNo, string regNo)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {

                MySqlParameter[] para = new MySqlParameter[]
                {
                    new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.预约成功.ToInt32()),
                    new MySqlParameter("@ApptTime", DateTime.Now),
                    new MySqlParameter("@RegNo", regNo),
                    new MySqlParameter("@VisitNo", vistiNo),
                    new MySqlParameter("@BookingNo", bookingNo),
                    new MySqlParameter("@Location", address),
                    new MySqlParameter("@OrderId", orderId)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,ApptTime = @ApptTime,RegNo=@RegNo,VisitNo=@VisitNo,BookingNo=@BookingNo,Location=@Location where Id=@OrderId", para);
            }
        }

        public void PaySuccess(int orderId,string wxTranscationId)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {
                MySqlParameter[] para = new MySqlParameter[]
                {
                        new MySqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.支付成功.ToInt32()),
                        new MySqlParameter("@WxTransactionId", wxTranscationId),
                        new MySqlParameter("@PayTime", DateTime.Now),
                        new MySqlParameter("@PayState", ApptOrderExtensions.PayState.已付款.ToInt32().ToString()),
                        new MySqlParameter("@OrderId", orderId)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayTime = @PayTime,PayState=@PayState, " +
                    "WxTransactionId=@WxTransactionId where Id=@OrderId", para);
            }
        }

        public void WeixinPaySuccess(int orderId,string transactionId,string timeEnd)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                    new MySqlParameter("@OrderStatus",
                        ApptOrderExtensions.OrderStatus.支付成功.ToInt32()),
                    new MySqlParameter("@WxTransactionId", transactionId),
                    new MySqlParameter("@PayTime",timeEnd.ToDateTimeOrDefault()),
                    new MySqlParameter("@PayState",
                        ApptOrderExtensions.PayState.已付款.ToInt32().ToString()),
                    new MySqlParameter("@OrderId", orderId)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayTime = @PayTime,PayState=@PayState, " +
                    "WxTransactionId=@WxTransactionId where Id=@OrderId", para);
            }
        }
    }

    public class SqlServerDatbaseCommand: IDbDatabaseCommand
    {
        public void UpdateOrderStatus(int orderId,int orderStatus)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para =
                {
                            new SqlParameter("@OrderStatus", orderStatus),
                            new SqlParameter("@OrderId", orderId),
                        };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus where Id=@OrderId", para);
            }
        }

        public void PickupSuccess(int orderId, string regNo, string beginTime, string endTime, string address, string visitNo)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                                new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.取号成功.ToInt32()),
                                new SqlParameter("@RegNo", regNo),
                                new SqlParameter("@SuggestBeginTime", beginTime),
                                new SqlParameter("@SuggestEndTime", endTime),
                                new SqlParameter("@Location", address),
                                new SqlParameter("@VisitNo", visitNo),
                                new SqlParameter("@FetchTime", DateTime.Now),
                                new SqlParameter("@OrderId",orderId)
                };
                ctx.Database.ExecuteSqlCommand("Update ApptOrder set OrderStatus= @OrderStatus," +
                                               "RegNo = @RegNo,SuggestBeginTime=@SuggestBeginTime," +
                                               "SuggestEndTime=@SuggestEndTime,Location=@Location,VisitNo=@VisitNo," +
                                               "FetchTime=@FetchTime where Id=@OrderId", para);
            }
        }

        public void Refunding(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para =
                {
                    new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.退款中.ToInt32()),
                    new SqlParameter("@PayState", ApptOrderExtensions.PayState.退款中.ToInt32().ToString()),
                    new SqlParameter("@RefundReason", "取号失败而退款"),
                    new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason where Id=@OrderId",
                    para);

            }
        }

        public void RefundSuccess(int orderId, string refundId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para = {
                        new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.退款成功.ToInt32()),
                        new SqlParameter("@PayState", ApptOrderExtensions.PayState.已退款.ToInt32().ToString()),
                        new SqlParameter("@RefundReason", "取号失败而退款"),
                        new SqlParameter("@RefundTime", DateTime.Now),
                        new SqlParameter("@WxRefundId", refundId),
                        new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason, " +
                    "RefundTime = @RefundTime,WxRefundId = @WxRefundId where Id=@OrderId", para);
            }
        }

        public void RefundError(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para = {
                        new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.退款失败.ToInt32()),
                        new SqlParameter("@PayState", ApptOrderExtensions.PayState.退款失败.ToInt32().ToString()),
                        new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState where Id=@OrderId",
                    para);

            }
        }

        public void WeixinRefunding(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para =
                {
                    new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.微信退号退款中.ToInt32()),
                    new SqlParameter("@PayState", ApptOrderExtensions.PayState.退款中.ToInt32().ToString()),
                    new SqlParameter("@RefundReason", "因退号而退款"),
                    new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason where Id=@OrderId",
                    para);
            }
        }

        public void WeixinRefundSuccess(int orderId, string refundId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para = {
                        new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.微信退号退款成功.ToInt32()),
                        new SqlParameter("@PayState", ApptOrderExtensions.PayState.已退款.ToInt32().ToString()),
                        new SqlParameter("@RefundReason", "因退号而退款"),
                        new SqlParameter("@RefundTime", DateTime.Now),
                        new SqlParameter("@WxRefundId", refundId),
                        new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState,RefundReason=@RefundReason, " +
                    "RefundTime = @RefundTime,WxRefundId = @WxRefundId where Id=@OrderId", para);
            }
        }

        public void WeixinRefundError(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para = {
                        new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.微信退号退款失败.ToInt32()),
                        new SqlParameter("@PayState", ApptOrderExtensions.PayState.退款失败.ToInt32().ToString()),
                        new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayState = @PayState where Id=@OrderId",
                    para);

            }
        }

        public void CancelByUser(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                            new SqlParameter("@CancelByUserTime", DateTime.Now),
                            new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set CancelByUserTime= @CancelByUserTime where Id=@OrderId", para);
            }
        }
        public void CancelBySys(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                            new SqlParameter("@CancelBySysTime", DateTime.Now),
                            new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set CancelBySysTime= @CancelBySysTime where Id=@OrderId", para);
            }
        }

        public void CancelByHosp(int orderId)
        {
            using (var ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                            new SqlParameter("@CancelByHospTime", DateTime.Now),
                            new SqlParameter("@OrderId", orderId)
                };
                ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set CancelByHospTime= @CancelByHospTime where Id=@OrderId", para);
            }
        }


        public void LockSuccessAndAppt(int orderId, string infoSeq)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para =
                {
                    new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.锁号成功.ToInt32()),
                    new SqlParameter("@LockTime", DateTime.Now),
                    new SqlParameter("@OrderId", orderId),
                    new SqlParameter("@InfoSeq",infoSeq)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,LockTime = @LockTime,InfoSeq=@InfoSeq where Id=@OrderId", para);


                SqlParameter[] para1 =
                {
                    new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.预约中.ToInt32()),
                    new SqlParameter("@OrderId", orderId),
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus where Id=@OrderId", para1);
            }

        }

        public void ApptSuccess(int orderId, string address, string bookingNo, string vistiNo, string regNo)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {

                SqlParameter[] para = new SqlParameter[]
                {
                    new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.预约成功.ToInt32()),
                    new SqlParameter("@ApptTime", DateTime.Now),
                    new SqlParameter("@RegNo", regNo),
                    new SqlParameter("@VisitNo", vistiNo),
                    new SqlParameter("@BookingNo", bookingNo),
                    new SqlParameter("@Location", address),
                    new SqlParameter("@OrderId", orderId)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,ApptTime = @ApptTime,RegNo=@RegNo,VisitNo=@VisitNo,BookingNo=@BookingNo,Location=@Location where Id=@OrderId", para);
            }
        }

        public void PaySuccess(int orderId, string wxTranscationId)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {
                SqlParameter[] para = {
                        new SqlParameter("@OrderStatus", ApptOrderExtensions.OrderStatus.支付成功.ToInt32()),
                        new SqlParameter("@WxTransactionId", wxTranscationId),
                        new SqlParameter("@PayTime", DateTime.Now),
                        new SqlParameter("@PayState", ApptOrderExtensions.PayState.已付款.ToInt32().ToString()),
                        new SqlParameter("@OrderId", orderId)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayTime = @PayTime,PayState=@PayState, " +
                    "WxTransactionId=@WxTransactionId where Id=@OrderId", para);
            }
        }


        public void WeixinPaySuccess(int orderId, string transactionId, string timeEnd)
        {
            using (var _ctx = new GdsfybjyWeiXinEntities())
            {
                var para = new[]
                {
                    new SqlParameter("@OrderStatus",
                        ApptOrderExtensions.OrderStatus.支付成功.ToInt32()),
                    new SqlParameter("@WxTransactionId", transactionId),
                    new SqlParameter("@PayTime",timeEnd.ToDateTimeOrDefault() ),
                    new SqlParameter("@PayState",
                        ApptOrderExtensions.PayState.已付款.ToInt32().ToString()),
                    new SqlParameter("@OrderId", orderId)
                };
                _ctx.Database.ExecuteSqlCommand(
                    "Update ApptOrder set OrderStatus= @OrderStatus,PayTime = @PayTime,PayState=@PayState, " +
                    "WxTransactionId=@WxTransactionId where Id=@OrderId", para);
            }
        }

    }
}